﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LowLevelGraphics.Filter
{
    /// <summary>
    /// 
    /// </summary>
    public class MotionDetection : BaseImageFilter, ITwoSourceFilter
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MotionDetection"/> class.
        /// </summary>
        public MotionDetection()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MotionDetection"/> class.
        /// </summary>
        /// <param name="_motionDetection">The _motion detection.</param>
        internal MotionDetection(MotionDetection _motionDetection)
        {
        }

        /// <summary>
        /// Execute this Filter
        /// A Debug Statement is written if a concrete Filter is called
        /// </summary>
        /// <param name="_bitmap"></param>
        /// <returns></returns>
        public override UnsafeBitmap Execute(UnsafeBitmap _bitmap)
        {
            return Process((UnsafeBitmap)_bitmap.Clone(), _bitmap);
        }

        #region ITwoSourceFilter Members

        /// <summary>
        /// Processes the specified _bitmap frame.
        /// </summary>
        /// <param name="_bitmapFrame">The _bitmap frame.</param>
        /// <param name="_bitmapFrame2">The _bitmap frame2.</param>
        /// <returns></returns>
        public UnsafeBitmap Process(UnsafeBitmap _bitmapFrame, UnsafeBitmap _bitmapFrame2)
        {
            return new SameColorValues(false).Process(_bitmapFrame, _bitmapFrame2);
        }

        #endregion

        /// <summary>
        /// This is used to clone a filter, each filter must implement it's own clone functionality
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            return new MotionDetection(this);
        }
    }
}
